package com.ffapp.demo.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class WarnMapListBean extends BaseListBeanXF {

    private ArrayList<WarnMapData> list = new ArrayList<WarnMapData>();
    private ArrayList<WarnMapData> data = new ArrayList<WarnMapData>();

    public ArrayList<WarnMapData> getList() {
        return list;
    }

    public void setList(ArrayList<WarnMapData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(WarnMapListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrent_page() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<WarnMapData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    @JSONField(serialize = false)
    public void removeList(List<WarnMapData> listTwo){
        if(listTwo == null){
            return;
        }
        if(list.size()<1)return;
        HashSet hs1 = new HashSet(list);
        HashSet hs2 = new HashSet(listTwo);
        hs1.removeAll(hs2);
        ArrayList<WarnMapData> listC = new ArrayList<WarnMapData>();
        listC.addAll(hs1);
        setList(listC);
    }

    public ArrayList<WarnMapData> getData() {
        return data;
    }

    public void setData(ArrayList<WarnMapData> data) {
        this.data = data;
    }
    public void chageDataToList() {
       list = data;
    }
}
